package com.ltu.model.request.alidto.req;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ltu.common.Constants;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

import java.util.Arrays;
import java.util.List;

/**
 * 获取IM服务Token的请求参数
 * @author chunlei.zcl
 */
@ApiModel(value = "获取IM服务Token的请求参数")
public class ImTokenRequestDto {
    @ApiModelProperty(value = "用户Id",hidden = true)
    @JsonProperty("user_id")
    private String userId;

    @ApiModelProperty(value = "设备Id")
    @NotBlank(message="deviceId不能为空")
    @JsonProperty("device_id")
    private String deviceId;
    @ApiModelProperty(value = "设备类型")
   
    @NotBlank(message="deviceType不能为空: ios  android  web  pc")
    @JsonProperty("device_type")
    private String deviceType="web";

    @ApiModelProperty(value = "im群列表",hidden = true)
    @JsonIgnore
    private List<String> imServer;

    @ApiModelProperty(value = "角色，为admin时，表示该用户可以调用管控接口")
    @JsonProperty("role")
    private String role = "";

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}

	public String getDeviceType() {
		return deviceType;
	}

	public void setDeviceType(String deviceType) {
		this.deviceType = deviceType;
	}

	public List<String> getImServer() {
		if(this.imServer == null)
			this.imServer = Arrays.asList(new String[]{Constants.IM_NEW});
		return imServer;
	}

	public void setImServer(List<String> imServer) {
		this.imServer = imServer;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}
    
    

}
